<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/iuie.tld" prefix="u"%>
<%@ page isELIgnored="false" %>
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/main.css">
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/font-awesome.css">
<link rel="stylesheet" href="${pageContext.request.contextPath }/jsp/file/css/fileList.css">
<title>文件列表</title>
</head>
<body class="mobile">
<form method="post" action="doUpload.do" enctype="multipart/form-data">
<div class="m-form">
<fieldset>
	<legend>文件上传</legend>
	<input type="file" name="file"/>
	<input type="submit" style="display:inline-block" class="m-btn submit"/>
</fieldset>
</div>
</form>
	<c:forEach var="item" items="${fileList }"  varStatus="i">
	<ul class="m-ul">
		<li><label>文件原始名称：</label>${item.originalName }</li>
		<li><label>上传时间：</label>${item.uploadTime }</li>
		<li><label>文件大小：</label>${item.fileSize }</li>
		<li><label>下载次数：</label><span id="file_download_count_${item.fileId }">${item.downloadCount }</span></li>
		<li><label>操作：</label>
			<a href="http://${pageContext.request.serverName}:8080/files/${item.fileId}.${u:getExtension(item.originalName) }" 
				download="${item.fileId}.${u:getExtension(item.originalName) }"
				onclick="javascript:Page.refresh('${pageContext.request.contextPath }','${item.fileId }')"><i class="fa fa-download">下载</i></a>
			<a style="margin-left:3.5em;" href="fileDelete.do?fileId=${item.fileId }"><i class="fa fa-trash-o">删除</i></a>
		</li>
	</ul>
	</c:forEach>
</body>
<script type="text/javascript" src="${pageContext.request.contextPath }/jsp/file/js/fileList.js"></script>
</html>